import React, { Component } from "react";
import { Route, Redirect, Switch, withRouter } from "react-router-dom";
import Home from "../../pages/home/home";
import User from "../../pages/user/user";
import Products from "../../pages/products/products";
import Line from "../../pages/line/line";
import Bar from "../../pages/bar/bar";
import Pie from "../../pages/pie/pie";
class Main extends Component {
  render() {
    return (
      <Switch>
        <Route path="/home" component={Home} />
        <Route path="/list/user" component={User} />
        <Route path="/list/products" component={Products} />
        <Route path="/eachers/line" component={Line} />
        <Route path="/eachers/bar" component={Bar} />
        <Route path="/eachers/pie" component={Pie} />
        <Redirect to="/home" />
      </Switch>
    );
  }
}

export default withRouter(Main);
